package server;
/*
生命周期相关异常
*/

/*
2023/2/7 该类内容全部写完,后续直接使用,无需修改
by cyl
 */
public final class LifecycleException extends Exception {
    protected String message = null;
    protected Throwable throwable = null;
    public LifecycleException() {
        this(null, null);
    }
    public LifecycleException(String message) {
        this(message, null);
    }
    public LifecycleException(Throwable throwable) {
        this(null, throwable);
    }
    public LifecycleException(String message, Throwable throwable) {
        super();
        this.message = message;
        this.throwable = throwable;
    }

    //getter---------------------------------------------------------------------------
    public String getMessage() {
        return message;
    }
    public Throwable getThrowable() {
        return throwable;
    }



    public String toString() {
        StringBuffer sb = new StringBuffer("LifecycleException:  ");
        if (message != null) {
            sb.append(message);
            if (throwable != null) {
                sb.append(":  ");
            }
        }
        if (throwable != null) {
            sb.append(throwable.toString());
        }
        return sb.toString();
    }
}
